home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 14.0 KB | 617 lines | [TEXT/MPS ] |
- ;
- ; File: MacTCP.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__MACTCP__') = 'UNDEFINED' THEN
- __MACTCP__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
- include 'AppleTalk.a'
- ENDIF
- ; include 'OSUtils.a' ;
- ; include 'MixedMode.a' ;
- ; include 'Memory.a' ;
-
- inProgress EQU 1 ; I/O in progress
- ipBadLapErr EQU -23000 ; bad network configuration
- ipBadCnfgErr EQU -23001 ; bad IP configuration error
- ipNoCnfgErr EQU -23002 ; missing IP or LAP configuration error
- ipLoadErr EQU -23003 ; error in MacTCP load
- ipBadAddr EQU -23004 ; error in getting address
- connectionClosing EQU -23005 ; connection is closing
- invalidLength EQU -23006
- connectionExists EQU -23007 ; request conflicts with existing connection
- connectionDoesntExist EQU -23008 ; connection does not exist
- insufficientResources EQU -23009 ; insufficient resources to perform request
- invalidStreamPtr EQU -23010
- streamAlreadyOpen EQU -23011
- connectionTerminated EQU -23012
- invalidBufPtr EQU -23013
- invalidRDS EQU -23014
- invalidWDS EQU -23014
- openFailed EQU -23015
- commandTimeout EQU -23016
- duplicateSocket EQU -23017
-
- ; Error codes from internal IP functions
- ipDontFragErr EQU -23032 ; Packet too large to send w/o fragmenting
- ipDestDeadErr EQU -23033 ; destination not responding
- icmpEchoTimeoutErr EQU -23035 ; ICMP echo timed-out
- ipNoFragMemErr EQU -23036 ; no memory to send fragmented pkt
- ipRouteErr EQU -23037 ; can't route packet off-net
- nameSyntaxErr EQU -23041
- cacheFault EQU -23042
- noResultProc EQU -23043
- noNameServer EQU -23044
- authNameErr EQU -23045
- noAnsErr EQU -23046
- dnrErr EQU -23047
- outOfMemory EQU -23048
-
- BYTES_16WORD EQU 2 ; bytes per = 16, bit ip word
- BYTES_32WORD EQU 4 ; bytes per = 32, bit ip word
- BYTES_64WORD EQU 8 ; bytes per = 64, bit ip word
-
- ip_addrbytes RECORD 0
- VariantLevel0Begin EQU *
- addr ds.l 1
- ORG VariantLevel0Begin
- bytes ds.b 4
- sizeof EQU 4
- ENDR
-
- wdsEntry RECORD 0
- length ds.w 1 ; length of buffer
- ptr ds.l 1 ; pointer to buffer
- sizeof EQU 6
- ENDR
-
- rdsEntry RECORD 0
- length ds.w 1 ; length of buffer
- ptr ds.l 1 ; pointer to buffer
- sizeof EQU 6
- ENDR
-
-
- netUnreach EQU 0
- hostUnreach EQU 1
- protocolUnreach EQU 2
- portUnreach EQU 3
- fragReqd EQU 4
- sourceRouteFailed EQU 5
- timeExceeded EQU 6
- parmProblem EQU 7
- missingOption EQU 8
-
- ICMPReport RECORD 0
- streamPtr ds.l 1
- localHost ds.l 1
- localPort ds.w 1
- remoteHost ds.l 1
- remotePort ds.w 1
- reportType ds.w 1
- optionalAddlInfo ds.w 1
- optionalAddlInfoPtr ds.l 1
- sizeof EQU 24
- ENDR
-
-
- NUM_ALT_ADDRS EQU 4
-
- hostInfo RECORD 0
- rtnCode ds.l 1
- cname ds.b 255
- filler ds.b 1 ; Filler for proper byte alignment
- addr ds.l 1
- sizeof EQU 264
- ENDR
-
-
- kA EQU 1
- kNS EQU 2
- kCNAME EQU 5
- kHINFO EQU 13
- kMX EQU 15
-
- HInfoRec RECORD 0
- cpuType ds.b 30
- osType ds.b 30
- sizeof EQU 60
- ENDR
-
- MXRec RECORD 0
- preference ds.w 1
- exchange ds.b 255
- sizeof EQU 258
- ENDR
-
- returnRec RECORD 0
- rtnCode ds.l 1
- cname ds.b 255
- filler ds.b 1 ; Filler for proper byte alignment
- VariantLevel0Begin EQU *
- addr ds.l 1
- ORG VariantLevel0Begin
- hinfo ds HInfoRec
- ORG VariantLevel0Begin
- mx ds MXRec
- sizeof EQU 518
- ENDR
-
- cacheEntryRecord RECORD 0
- cname ds.l 1
- ctype ds.w 1
- cacheClass ds.w 1
- ttl ds.l 1
- VariantLevel0Begin EQU *
- name ds.l 1
- ORG VariantLevel0Begin
- addr ds.l 1
- sizeof EQU 16
- ENDR
-
- ; csCode to get our IP address
-
- ipctlGetAddr EQU 15
-
- GetAddrParamBlock RECORD 0
- qLink ds.l 1
- qType ds.w 1
- ioTrap ds.w 1
- ioCmdAddr ds.l 1
- ioCompletion ds.l 1
- ioResult ds.w 1
- ioNamePtr ds.l 1
- ioVRefNum ds.w 1
- ioCRefNum ds.w 1
- csCode ds.w 1 ; standard I/O header
- ourAddress ds.l 1 ; our IP address
- ourNetMask ds.l 1 ; our IP net mask
- sizeof EQU 36
- ENDR
-
- ; control codes
-
- ipctlEchoICMP EQU 17 ; send icmp echo
- ipctlLAPStats EQU 19 ; get lap stats
-
- ICMPParamBlock RECORD 0
- qLink ds.l 1
- qType ds.w 1
- ioTrap ds.w 1
- ioCmdAddr ds.l 1
- ioCompletion ds.l 1
- ioResult ds.w 1
- ioNamePtr ds.l 1
- ioVRefNum ds.w 1
- ioCRefNum ds.w 1
- csCode ds.w 1 ; standard I/O header
- params ds.w 11
- echoRequestOut ds.l 1 ; time in ticks of when the echo request went out
- echoReplyIn ds.l 1 ; time in ticks of when the reply was received
- echoedData ds rdsEntry ; data received in responce
- options ds.l 1
- userDataPtr ds.l 1
-
- sizeof EQU 72
- ENDR
-
-
- NBP_TABLE_SIZE EQU 20 ; number of NBP table entries
- NBP_MAX_NAME_SIZE EQU 16 + 10 + 2
-
- nbp_entry RECORD 0
- ip_address ds.l 1 ; IP address
- at_address ds AddrBlock ; matching AppleTalk address
- gateway ds.b 1 ; TRUE if entry for a gateway
- valid ds.b 1 ; TRUE if LAP address is valid
- probing ds.b 1 ; TRUE if NBP lookup pending
- afiller ds.b 1 ; Filler for proper byte alignment
- age ds.l 1 ; ticks since cache entry verified
- access ds.l 1 ; ticks since last access
- filler ds.b 116 ; for internal use only !!!
- sizeof EQU 136
- ENDR
-
- ; number of ARP table entries
-
- ARP_TABLE_SIZE EQU 20
-
- Enet_addr RECORD 0
- en_hi ds.w 1
- en_lo ds.l 1
- sizeof EQU 6
- ENDR
-
- arp_entry RECORD 0
- age ds.w 1 ; cache aging field
- protocol ds.w 1 ; Protocol type
- ip_address ds.l 1 ; IP address
- en_address ds Enet_addr ; matching Ethernet address
- sizeof EQU 14
- ENDR
-
- ; Command codes
-
- TCPCreate EQU 30
- TCPPassiveOpen EQU 31
- TCPActiveOpen EQU 32
- TCPSend EQU 34
- TCPNoCopyRcv EQU 35
- TCPRcvBfrReturn EQU 36
- TCPRcv EQU 37
- TCPClose EQU 38
- TCPAbort EQU 39
- TCPStatus EQU 40
- TCPExtendedStat EQU 41
- TCPRelease EQU 42
- TCPGlobalInfo EQU 43
- TCPCtlMax EQU 49
-
- IPParamBlock RECORD 0
- qLink ds.l 1
- qType ds.w 1
- ioTrap ds.w 1
- ioCmdAddr ds.l 1
- ioCompletion ds.l 1
- ioResult ds.w 1
- ioNamePtr ds.l 1
- ioVRefNum ds.w 1
- ioCRefNum ds.w 1
- csCode ds.w 1 ; standard I/O header
- VariantLevel0Begin EQU *
- dest ds.l 1 ; echo to IP address
- data ds wdsEntry
- timeout ds.w 1
- options ds.l 1
- optLength ds.w 1
- icmpCompletion ds.l 1
- userDataPtr ds.l 1
-
- ORG VariantLevel0Begin
- lapStatsPtr ds.l 1
-
- sizeof EQU 54
- ENDR
-
- AddressXlation RECORD 0
- VariantLevel0Begin EQU *
- arp_table ds.l 1
- ORG VariantLevel0Begin
- nbp_table ds.l 1
- sizeof EQU 4
- ENDR
-
- LAPStats RECORD 0
- ifType ds.w 1
- ifString ds.l 1
- ifMaxMTU ds.w 1
- ifSpeed ds.l 1
- ifPhyAddrLength ds.w 1
- ifPhysicalAddress ds.l 1
- AddrXlation ds.l 1
- slotNumber ds.w 1
- sizeof EQU 24
- ENDR
-
-
- TCPClosing EQU 1
- TCPULPTimeout EQU 2
- TCPTerminate EQU 3
- TCPDataArrival EQU 4
- TCPUrgent EQU 5
- TCPICMPReceived EQU 6
-
- TCPRemoteAbort EQU 2
- TCPNetworkFailure EQU 3
- TCPSecPrecMismatch EQU 4
- TCPULPTimeoutTerminate EQU 5
- TCPULPAbort EQU 6
- TCPULPClose EQU 7
- TCPServiceError EQU 8
-
- ; ValidityFlags
- timeoutValue EQU $80
- timeoutAction EQU $40
- typeOfService EQU $20
- precedence EQU $10
-
- ; TOSFlags
- lowDelay EQU $01
- throughPut EQU $02
- reliability EQU $04
-
- TCPCreatePB RECORD 0
- rcvBuff ds.l 1
- rcvBuffLen ds.l 1
- notifyProc ds.l 1
- userDataPtr ds.l 1
- sizeof EQU 16
- ENDR
-
- TCPOpenPB RECORD 0
- ulpTimeoutValue ds.b 1
- ulpTimeoutAction ds.b 1
- validityFlags ds.b 1
- commandTimeoutValue ds.b 1
- remoteHost ds.l 1
- remotePort ds.w 1
- localHost ds.l 1
- localPort ds.w 1
- tosFlags ds.b 1
- precedence ds.b 1
- dontFrag ds.b 1
- timeToLive ds.b 1
- security ds.b 1
- optionCnt ds.b 1
- options ds.b 40
- userDataPtr ds.l 1
- sizeof EQU 66
- ENDR
-
- TCPSendPB RECORD 0
- ulpTimeoutValue ds.b 1
- ulpTimeoutAction ds.b 1
- validityFlags ds.b 1
- filler ds.b 1 ; Filler for proper byte alignment
- pushFlag ds.b 1
- urgentFlag ds.b 1
- wdsPtr ds.l 1
- sendFree ds.l 1
- sendLength ds.w 1
- userDataPtr ds.l 1
- sizeof EQU 20
- ENDR
-
- ; for receive and return rcv buff calls
- TCPReceivePB RECORD 0
- commandTimeoutValue ds.b 1
- filler ds.b 1
- markFlag ds.b 1
- urgentFlag ds.b 1
- rcvBuff ds.l 1
- rcvBuffLen ds.w 1
- rdsPtr ds.l 1
- rdsLength ds.w 1
- secondTimeStamp ds.w 1
- userDataPtr ds.l 1
- sizeof EQU 22
- ENDR
-
- TCPClosePB RECORD 0
- ulpTimeoutValue ds.b 1
- ulpTimeoutAction ds.b 1
- validityFlags ds.b 1
- filler ds.b 1 ; Filler for proper byte alignment
- userDataPtr ds.l 1
- sizeof EQU 8
- ENDR
-
- HistoBucket RECORD 0
- value ds.w 1
- counter ds.l 1
- sizeof EQU 6
- ENDR
-
-
- NumOfHistoBuckets EQU 7
-
- TCPConnectionStats RECORD 0
- dataPktsRcvd ds.l 1
- dataPktsSent ds.l 1
- dataPktsResent ds.l 1
- bytesRcvd ds.l 1
- bytesRcvdDup ds.l 1
- bytesRcvdPastWindow ds.l 1
- bytesSent ds.l 1
- bytesResent ds.l 1
- numHistoBuckets ds.w 1
- sentSizeHisto ds HistoBucket
- lastRTT ds.w 1
- tmrSRTT ds.w 1
- rttVariance ds.w 1
- tmrRTO ds.w 1
- sendTries ds.b 1
- sourchQuenchRcvd ds.b 1
- sizeof EQU 50
- ENDR
-
- TCPStatusPB RECORD 0
- ulpTimeoutValue ds.b 1
- ulpTimeoutAction ds.b 1
- unused ds.l 1
- remoteHost ds.l 1
- remotePort ds.w 1
- localHost ds.l 1
- localPort ds.w 1
- tosFlags ds.b 1
- precedence ds.b 1
- connectionState ds.b 1
- filler ds.b 1 ; Filler for proper byte alignment
- sendWindow ds.w 1
- rcvWindow ds.w 1
- amtUnackedData ds.w 1
- amtUnreadData ds.w 1
- securityLevelPtr ds.l 1
- sendUnacked ds.l 1
- sendNext ds.l 1
- congestionWindow ds.l 1
- rcvNext ds.l 1
- srtt ds.l 1
- lastRTT ds.l 1
- sendMaxSegSize ds.l 1
- connStatPtr ds.l 1
- userDataPtr ds.l 1
- sizeof EQU 70
- ENDR
-
- TCPAbortPB RECORD 0
- userDataPtr ds.l 1
- sizeof EQU 4
- ENDR
-
- TCPParam RECORD 0
- tcpRtoA ds.l 1
- tcpRtoMin ds.l 1
- tcpRtoMax ds.l 1
- tcpMaxSegSize ds.l 1
- tcpMaxConn ds.l 1
- tcpMaxWindow ds.l 1
- sizeof EQU 24
- ENDR
-
- TCPStats RECORD 0
- tcpConnAttempts ds.l 1
- tcpConnOpened ds.l 1
- tcpConnAccepted ds.l 1
- tcpConnClosed ds.l 1
- tcpConnAborted ds.l 1
- tcpOctetsIn ds.l 1
- tcpOctetsOut ds.l 1
- tcpOctetsInDup ds.l 1
- tcpOctetsRetrans ds.l 1
- tcpInputPkts ds.l 1
- tcpOutputPkts ds.l 1
- tcpDupPkts ds.l 1
- tcpRetransPkts ds.l 1
- sizeof EQU 52
- ENDR
-
- TCPGlobalInfoPB RECORD 0
- tcpParamPtr ds.l 1
- tcpStatsPtr ds.l 1
- tcpCDBTable ds.l 1
- userDataPtr ds.l 1
- maxTCPConnections ds.w 1
- sizeof EQU 18
- ENDR
-
- TCPiopb RECORD 0
- fill12 ds.b 12
- ioCompletion ds.l 1
- ioResult ds.w 1
- ioNamePtr ds.l 1
- ioVRefNum ds.w 1
- ioCRefNum ds.w 1
- csCode ds.w 1
- tcpStream ds.l 1
- VariantLevel0Begin EQU *
- create ds TCPCreatePB
- ORG VariantLevel0Begin
- open ds TCPOpenPB
- ORG VariantLevel0Begin
- send ds TCPSendPB
- ORG VariantLevel0Begin
- receive ds TCPReceivePB
- ORG VariantLevel0Begin
- close ds TCPClosePB
- ORG VariantLevel0Begin
- abort ds TCPAbortPB
- ORG VariantLevel0Begin
- status ds TCPStatusPB
- ORG VariantLevel0Begin
- globalInfo ds TCPGlobalInfoPB
- sizeof EQU 102
- ENDR
-
-
- UDPCreate EQU 20
- UDPRead EQU 21
- UDPBfrReturn EQU 22
- UDPWrite EQU 23
- UDPRelease EQU 24
- UDPMaxMTUSize EQU 25
- UDPStatus EQU 26
- UDPMultiCreate EQU 27
- UDPMultiSend EQU 28
- UDPMultiRead EQU 29
- UDPCtlMax EQU 29
-
- UDPDataArrival EQU 1
- UDPICMPReceived EQU 2
-
- ; for create and release calls
- UDPCreatePB RECORD 0
- rcvBuff ds.l 1
- rcvBuffLen ds.l 1
- notifyProc ds.l 1
- localPort ds.w 1
- userDataPtr ds.l 1
- endingPort ds.w 1
- sizeof EQU 20
- ENDR
-
- UDPSendPB RECORD 0
- reserved ds.w 1
- remoteHost ds.l 1
- remotePort ds.w 1
- wdsPtr ds.l 1
- checkSum ds.b 1
- filler ds.b 1 ; Filler for proper byte alignment
- sendLength ds.w 1
- userDataPtr ds.l 1
- localPort ds.w 1
- sizeof EQU 22
- ENDR
-
- ; for receive and buffer return calls
- UDPReceivePB RECORD 0
- timeOut ds.w 1
- remoteHost ds.l 1
- remotePort ds.w 1
- rcvBuff ds.l 1
- rcvBuffLen ds.w 1
- secondTimeStamp ds.w 1
- userDataPtr ds.l 1
- destHost ds.l 1 ; only for use with multi rcv
- destPort ds.w 1 ; only for use with multi rcv
- sizeof EQU 26
- ENDR
-
- UDPMTUPB RECORD 0
- mtuSize ds.w 1
- remoteHost ds.l 1
- userDataPtr ds.l 1
- sizeof EQU 10
- ENDR
-
- UDPiopb RECORD 0
- fill12 ds.b 12
- ioCompletion ds.l 1
- ioResult ds.w 1
- ioNamePtr ds.l 1
- ioVRefNum ds.w 1
- ioCRefNum ds.w 1
- csCode ds.w 1
- udpStream ds.l 1
- VariantLevel0Begin EQU *
- create ds UDPCreatePB
- ORG VariantLevel0Begin
- send ds UDPSendPB
- ORG VariantLevel0Begin
- receive ds UDPReceivePB
- ORG VariantLevel0Begin
- mtu ds UDPMTUPB
- sizeof EQU 58
- ENDR
-
- ENDIF ; __MACTCP__
-